package com.keeley.spider.server;

import org.apache.log4j.Logger;

/**
 * Created with IntelliJ IDEA.
 * User: Tianjun
 * Date: 14-9-25
 * Time: 下午4:22
 *门面模式
 */
public class SpiderServerFacade extends AbsSpiderFacade{

    private SpiderServer spiderServer;
    private static Logger log =  Logger.getLogger(SpiderServerFacade.class);

    //门面模式
    protected boolean process(String apkName) throws Exception{
        log.info(spiderServer.name+"开始抓取:"+apkName);
        spiderServer.setApkName(apkName);
        String url = spiderServer.getDownUrl();
        String localUrl = spiderServer.DownApk(url);
        boolean flag =spiderServer.checkUpdate(localUrl);
        return flag;
    }

    protected SpiderServerFacade(SpiderServer spiderServer) {
              this.spiderServer = spiderServer;
    }
}
